package main

import (
	"time"

	"github.com/samuel/go-zookeeper/zk"
)

type ZKClient struct {
	zkaddrs []string
	conn    *zk.Conn
}

func NewZKClient(addrs []string) (*ZKClient, error) {
	client := &ZKClient{
		zkaddrs: addrs,
	}
	c, _, err := zk.Connect(addrs, time.Second*10)
	if err != nil {
		return nil, err
	}
	client.conn = c
	return client, nil
}
